﻿<UserControl x:Class="BathroomLocator.Phone.PivotContent.BathroomListPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
	d:DataContext="{d:DesignData ../DesignData/BathroomListPageViewSampleData.xaml}"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="768" d:DesignWidth="480">

	<!--Background="{StaticResource PhoneChromeBrush}"-->
	<Grid x:Name="LayoutRoot">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>
		
		<Grid x:Name="Content" Grid.Row="1">
			<Grid.RowDefinitions>
				<RowDefinition Height="*"/>
				<RowDefinition Height="Auto"/>
			</Grid.RowDefinitions>
			
			<ListBox Grid.Row="0" Margin="12, 0, 12, 12"
					 HorizontalAlignment="Left"
					 ItemsSource="{Binding Table}"
					 VerticalAlignment="Top"
					 Width="455"
					 Height="600"
					 SelectionChanged="ListBox_SelectionChanged">
				<ListBox.ItemTemplate>
					<DataTemplate>
						<StackPanel>
							<TextBlock Text="{Binding FacilityName}" 
									   TextWrapping="Wrap"/>
							<TextBlock Text="{Binding AddressLine1}" 
									   TextWrapping="Wrap"
									   Margin="25, 5, 0, 0"/>
							<TextBlock Text="{Binding City}" 
									   TextWrapping="Wrap"
									   Margin="25, 0, 0, 0"/>
							<TextBlock Text="{Binding State}" 
									   TextWrapping="Wrap"
									   Margin="25, 5, 0, 0"/>
							<TextBlock Text="{Binding ZipCode}" 
									   TextWrapping="Wrap"
									   Margin="25, 5, 0, 15"/>
						</StackPanel>
					</DataTemplate>
				</ListBox.ItemTemplate>
			</ListBox>

			<StackPanel Grid.Row="1" Margin="12,0,12,12" Orientation="Vertical" VerticalAlignment="Bottom">
				<TextBlock Text="{Binding Message}" HorizontalAlignment="Left" TextWrapping="Wrap" />
				<ProgressBar Height="20" IsIndeterminate="True" Visibility="{Binding IsLoading, Converter={StaticResource VisibilityConverter}}" />
			</StackPanel>
		</Grid>
    </Grid>
</UserControl>
